<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/css/index.css}">
    <script th:src="@{/js/jquery-3.6.0.min.js}"></script>
</head>
<body>
<div class="all">
    <hr/>
    <div class="top-box">
        <div id="current-path">
            <span class="path" onclick="loadRootFiles()">[[${currentPath}]]</span>
        </div>
        <div class="operation">
            <img th:src="@{/icon/home.png}" alt="根目录" onclick="loadRootFiles()">
            <img th:src="@{/icon/back.png}" alt="上一级" onclick="loadParentFiles()">
        </div>
    </div>
    <hr/>
    <table>
        <tr th:each="node:${nodes}">
            <td th:text="${node.fileName}" th:if="${node.directory}" th:title="${node.fileName}" th:onclick="loadFiles([[${node.filePath}]])"></td>
            <td th:text="${node.fileName}" th:if="${!node.directory}" th:title="${node.fileName}"></td>
            <td th:text="${#dates.format(node.lastModifiedDate, 'yyyy-MM-dd HH:mm:ss')}"></td>
            <td th:if="${!node.directory}" th:text="${node.fileSize}"></td>
            <td th:if="${!node.directory}">
                <button th:onclick="download([[${node.filePath}]])">下载</button>
            </td>
        </tr>
    </table>
<!--<button onclick="download('D:\\preview.jpg')">测试按钮</button>-->
</div>
</body>
<script th:src="@{/js/index.js}"></script>
</html>